<?php 
class Bulletins extends E_Entity 
{
	public   $table =array(
					"id" =>"id",
					"version"=>"version",
					"modid" =>"modid",
					"content" =>"content",  
					"sign" =>"sign",
					"status" =>"status",
					"ctime" =>"ctime",
					"mtime" =>"mtime"
					);
					
	public function getTableName()
	{
		return "micro_bulletin";
	}
	public static function insertEntity($row)
	{	
		$entity = new self();
	 	return $entity->createEntityForRow($row);
	}
	public static function getById($id)
	{
		$entity = new self();
		$sql =  "select * from {$entity->getTableName()} where  {$entity->table['id']} = :id";
		return $entity->getEntityByIndexKey($sql, $id, array("id"=>$id));
	}
	public static function getByModId($modid)
	{
		$entity = new self();
		$sql =  "select * from {$entity->getTableName()} where  {$entity->table['modid']} = :modid";
		return $entity->getEntityByIndexKey($sql, $id, array("modid"=>$modid));
	}
	public static function getList()
	{
		$entity = new self();
		$sql =  "select * from {$entity->getTableName()} ";
		return $entity->birthEntity($sql);
	}
	public  function getContent()
	{
		$content = $this->content;
		return regUBB(regExpContent($content,500, 500));
	}
	
}
?>